home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gwu / edit.h < prev    next >
C/C++ Source or Header  |  1996-01-30  |  6KB  |  225 lines

  1. /*
  2.     GWAda Development Environment for 386/486 PCs   
  3.     Copyright (C) 1993, Arthur Vargas Lopes  & Michael Bliss Feldman
  4.                         vlopes@vortex.ufrgs.br mfeldman@seas.gwu.edu
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; version 2 of the License.    
  9.  
  10.     This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.     GNU General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU General Public License
  16.     along with this program; if not, write to the Free Software
  17.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19.  
  20. #include <graph.h>
  21.  
  22. #define GWAda_Version       "IV.1"
  23. #define AVL_MAX_GEN_PARS    6
  24. #define AVL_TOOL_FNAME        "avltool.mnu"
  25. #define AVL_TOOL_MAX        550
  26. #define AVL_TOOL_MAX_MENU    40
  27. #define AVL_MAX_UNITS       350
  28. #define AVL_MAX_NAME_SIZE   60
  29. #define AVL_MENU_ITEMS      10
  30. #define AVL_MAX_FILE_NAME   128
  31. #define AVL_MAX_WINDOWS     8
  32. #define AVL_MAX_LINEL       256
  33. #define AVL_MAX_COLORS      16
  34. #define AVL_FN_OPTIONS      "GWAda.opt"
  35. #define AVL_DEFAULT_LIB     "MyLib"
  36. #define AVL_TEXT_COLOR      15  /* White */
  37. #define AVL_TEXT_BK_COLOR   1   /* Blue */
  38. #define AVL_WIND_COLOR      15  /* White */
  39. #define AVL_WIND_BK_COLOR   7   /* Gray */
  40. #define AVL_WIND_TITLE      11  /* Light blue */
  41. #define AVL_QUES_COLOR      1   /* Blue */
  42. #define AVL_QUES_BK_COLOR   7   /* Gray */
  43. #define AVL_PROM_COLOR      15  /* White */
  44. #define AVL_PROM_BK_COLOR   0   /* Black */
  45. #define AVL_MENU_READY      4   /* Red */
  46. #define AVL_MENU_LETTER     1   /* Blue */
  47. #define AVL_MENU_WORD       9   /* light blue */
  48. #define AVL_MENU_BK_COLOR   7   /* Gray */
  49. #define AVL_ERRO_COLOR      4   /* red */
  50. #define AVL_STAT_BK_COLOR   AVL_TEXT_BK_COLOR
  51. #define AVL_STAT_COLOR      11
  52. #define AVL_MESG_COLOR      1
  53. #define AVL_MESG_BK_COLOR   4
  54. #define AVL_NO_COLORS_OPTS  18
  55. #define avl_video_base_address  0xB8000
  56. #define AVL_MAP(r,c)  ((short *) (avl_video_base_address + (r - 1) * 160 + (c - 1) * 2))
  57. #define AVL_PUT(ch,r,c,bk,cor) *AVL_MAP(r,c) = ((char) ch) | ((short) (((bk << 4) | cor) << 8))
  58. #define AVL_ATT(r,c) ((char) ((AVL_MAP(r,c)) >> 8))
  59. #define AVL_CH(r,c)  ((char) *AVL_MAP(r,c))
  60.  
  61.  
  62. typedef    struct {
  63.         char st;
  64.         char name[AVL_MAX_NAME_SIZE + 1];
  65.         } *AVL_BIND_PTR, AVL_BIND_SIZE;
  66.  
  67.  
  68.  
  69. typedef struct {
  70.         char status;
  71.         char is_main;
  72.         char cdate[5];
  73.         char fu[AVL_MAX_NAME_SIZE + 1];
  74.         } AVL_UNIT_DATA;
  75.  
  76. typedef struct {
  77.     AVL_UNIT_DATA s[AVL_MAX_UNITS];
  78.     int ns; 
  79.     } *AVL_UNITDT_PTR, AVL_UNITDT;
  80.  
  81. typedef struct {
  82.     char sources[AVL_MAX_NAME_SIZE + 1];
  83.     char library[AVL_MAX_NAME_SIZE + 1];
  84.     int tabsize;
  85.  
  86.     short avl_heap;
  87.     short avl_pgm_stack;
  88.     short avl_task_stack;
  89.     short avl_scheduller;
  90.     char  avl_trace_opts[6];
  91.         
  92.     short avl_txt_color;
  93.     short avl_txt_bk_color;
  94.     short avl_wnd_color;
  95.     short avl_wnd_title;
  96.     short avl_wnd_bk_color;
  97.     short avl_que_color;
  98.     short avl_que_bk_color;
  99.     short avl_pro_color;
  100.     short avl_pro_bk_color;
  101.     short avl_men_ready;
  102.     short avl_men_letter;
  103.     short avl_men_word;
  104.     short avl_men_bk_color;
  105.     short avl_err_color;
  106.     short avl_sta_color;
  107.     short avl_sta_bk_color;
  108.     short avl_msg_color;
  109.     short avl_msg_bk_color;
  110.     char  avl_monitor_on;
  111.     } AVL_OPTIONS;
  112.  
  113. typedef struct line_node {
  114.     char line[AVL_MAX_LINEL + 1];
  115.     int  line_no;
  116.     char line_attrib;
  117.     struct line_node *previous;
  118.     struct line_node *next;
  119.     } AVL_LINE_SIZE, *AVL_LINE_PTR;
  120.  
  121. typedef struct {
  122.     char video[4000];
  123.     long bk;
  124.     short co;
  125.     short r1, c1, r2, c2;
  126.     struct rccoord pos;
  127.     } AVL_WIN_SIZE, *AVL_WIN_PTR;
  128.  
  129. typedef void (*PROC_NAME)();
  130.  
  131. typedef struct node {
  132.     char file_name[AVL_MAX_FILE_NAME+1];
  133.     long buffer_size;
  134.     short r1, c1,  /*  upper-left corner of window  */
  135.           r2, c2;  /*  lower-right corner of window */
  136.     int txt_col;
  137.     int scr_col;
  138.     int scr_row;
  139.     int offset;
  140.     char no_status;
  141.     char changed;
  142.     int tabsize;
  143.     int no_errors;
  144.     int line_no; /*  where error was found  */
  145.     int txt_pos; /*  where editing and scanning is in  */
  146.     AVL_LINE_PTR head;
  147.     AVL_LINE_PTR current_line;
  148.     char expanded_line[1025];
  149.     char edit_mode;
  150.     AVL_WIN_SIZE sw;
  151.     struct node *avl_w;
  152.     AVL_WIN_PTR avl_win1;
  153.     PROC_NAME fix;
  154.     PROC_NAME insert;
  155.     PROC_NAME options;
  156.     PROC_NAME delete;
  157.     PROC_NAME error;
  158.     struct node *previous, *next;
  159.     }  AVL_EDIT_WINDOW, *AVL_EDIT_WINDOW_PTR;
  160.  
  161. typedef struct {
  162.     short r, c;
  163.     char *tit;
  164.     } AVL_TIT;
  165.  
  166.  
  167. typedef struct {
  168.     short ret_edit;
  169.     char *sm;
  170.     PROC_NAME proc;
  171.     } AVL_SMENU_SEL;
  172.     
  173. typedef struct {
  174.     int r, c;
  175.     AVL_SMENU_SEL s[23];
  176.     } AVL_STIT;
  177.  
  178.  
  179. typedef struct {
  180.     short isbk;
  181.     char *where;
  182.     short *who;
  183.     } AVL_COLOR_CHOICES;
  184.  
  185.  
  186. typedef struct {
  187.     char menu_item[AVL_TOOL_MAX_MENU+1];
  188.     char source[AVL_MAX_FILE_NAME+1]; 
  189.     } *AVL_MENU_PTR, AVL_MENU_SIZE;
  190.  
  191. typedef struct {
  192.     AVL_MENU_SIZE menu[AVL_TOOL_MAX];
  193.     int no_menu;
  194.     } *AVL_TOOL_PTR, AVL_TOOL_SIZE;
  195.  
  196.  
  197. typedef struct {
  198.     char  type; /* I = generic unit S = Source code ... */
  199.     char  pname  [AVL_MAX_LINEL + 1];
  200.     char  help   [AVL_MAX_FILE_NAME+1];
  201.     char  with   [AVL_MAX_LINEL + 1];
  202.     char  package[AVL_MAX_LINEL + 1];
  203.     char  gen_pars[AVL_MAX_GEN_PARS][AVL_MAX_LINEL + 1];
  204.     short n_pars;
  205.     } *AVL_T_MENU_PTR, AVL_T_MENU_SIZE;
  206.  
  207. typedef struct {
  208.     AVL_MENU_SIZE menu[AVL_TOOL_MAX];
  209.     AVL_T_MENU_SIZE more[AVL_TOOL_MAX];
  210.     int no_menu;
  211.     } *AVL_T_TOOL_PTR, AVL_T_TOOL_SIZE;
  212.  
  213. typedef void (*PROC_TOOL)(AVL_T_TOOL_PTR t);
  214.  
  215. typedef struct {
  216.     char *tool_opt;
  217.     PROC_TOOL proc;
  218.     } TOOL_SIZE;
  219.  
  220.  
  221. typedef struct {
  222.     char name[AVL_TOOL_MAX][13];
  223.     int no_files;
  224.     } AVL_SOURCE_SIZE, *AVL_SOURCE_PTR;
  225.